﻿<?xml version="1.0" encoding="utf-8"?>
<Witd:WITD application="Work item type editor" version="1.0" xmlns:Witd="http://schemas.microsoft.com/VisualStudio/2008/workitemtracking/typedef">
  <WORKITEMTYPE name="Issue">
    <DESCRIPTION>Tracks an obstacle to progress.</DESCRIPTION>
    <FIELDS>
      <FIELD name="Id" refname="System.Id" type="Integer" />
      <FIELD name="Title" refname="System.Title" type="String">
        <REQUIRED />
        <HELPTEXT>The nature of the problem and why it is affecting or could affect the project</HELPTEXT>
      </FIELD>
      <FIELD name="Description" refname="System.Description" type="PlainText">
        <HELPTEXT>Problem, resolution plan and status</HELPTEXT>
      </FIELD>
      <FIELD name="Assigned To" refname="System.AssignedTo" type="String" syncnamechanges="true">
        <ALLOWEXISTINGVALUE />
        <VALIDUSER />
        <HELPTEXT>The person currently working on this issue</HELPTEXT>
      </FIELD>
      <FIELD name="Area Path" refname="System.AreaPath" type="TreePath">
        <HELPTEXT>The area of the product with which this issue is associated</HELPTEXT>
      </FIELD>
      <FIELD name="Iteration Path" refname="System.IterationPath" type="TreePath">
        <HELPTEXT>The iteration within which this issue will be fixed</HELPTEXT>
      </FIELD>
      <FIELD name="History" refname="System.History" type="History">
        <HELPTEXT>Discussion thread plus automatic record of changes</HELPTEXT>
      </FIELD>
      <FIELD name="State" refname="System.State" type="String">
        <HELPTEXT>Change to Closed when the issue is resolved or not relevant anymore</HELPTEXT>
      </FIELD>
      <FIELD name="Reason" refname="System.Reason" type="String">
        <HELPTEXT>The reason why the issue is in the current state</HELPTEXT>
      </FIELD>
      <FIELD name="Changed Date" refname="System.ChangedDate" type="DateTime" />
      <FIELD name="Changed By" refname="System.ChangedBy" type="String" syncnamechanges="true">
        <VALIDUSER />
        <ALLOWEXISTINGVALUE />
      </FIELD>
      <FIELD name="Created Date" refname="System.CreatedDate" type="DateTime" />
      <FIELD name="Created By" refname="System.CreatedBy" type="String" syncnamechanges="true" />
      <FIELD name="State Change Date" refname="Microsoft.VSTS.Common.StateChangeDate" type="DateTime">
        <WHENCHANGED field="System.State">
          <SERVERDEFAULT from="clock" />
        </WHENCHANGED>
        <WHENNOTCHANGED field="System.State">
          <READONLY />
        </WHENNOTCHANGED>
      </FIELD>
      <FIELD name="Activated Date" refname="Microsoft.VSTS.Common.ActivatedDate" type="DateTime" reportable="dimension">
        <WHENNOTCHANGED field="System.State">
          <READONLY />
        </WHENNOTCHANGED>
      </FIELD>
      <FIELD name="Activated By" refname="Microsoft.VSTS.Common.ActivatedBy" type="String" syncnamechanges="true" reportable="dimension">
        <WHENNOTCHANGED field="System.State">
          <READONLY />
        </WHENNOTCHANGED>
        <ALLOWEXISTINGVALUE />
      </FIELD>
      <FIELD name="Closed Date" refname="Microsoft.VSTS.Common.ClosedDate" type="DateTime" reportable="dimension">
        <WHENNOTCHANGED field="System.State">
          <READONLY />
        </WHENNOTCHANGED>
      </FIELD>
      <FIELD name="Closed By" refname="Microsoft.VSTS.Common.ClosedBy" type="String" syncnamechanges="true" reportable="dimension">
        <WHENNOTCHANGED field="System.State">
          <READONLY />
        </WHENNOTCHANGED>
        <ALLOWEXISTINGVALUE />
      </FIELD>
      <FIELD name="Priority" refname="Microsoft.VSTS.Common.Priority" type="Integer" reportable="dimension">
        <ALLOWEDVALUES>
          <LISTITEM value="1" />
          <LISTITEM value="2" />
          <LISTITEM value="3" />
          <LISTITEM value="4" />
        </ALLOWEDVALUES>
        <DEFAULT from="value" value="2" />
        <HELPTEXT>Business importance. 1=must fix; 4=unimportant.</HELPTEXT>
      </FIELD>
      <FIELD name="Stack Rank" refname="Microsoft.VSTS.Common.StackRank" type="Double" reportable="dimension">
        <HELPTEXT>Work first on items with lower-valued stack rank. Set in triage.</HELPTEXT>
      </FIELD>
      <FIELD name="Due Date" refname="Microsoft.VSTS.Scheduling.DueDate" type="DateTime" reportable="dimension">
        <HELPTEXT>The date by which this issue needs to be closed</HELPTEXT>
      </FIELD>
      <!-- **************** Team Build Integration Fields **************  -->
      <FIELD name="Integration Build" refname="Microsoft.VSTS.Build.IntegrationBuild" type="String" reportable="dimension">
        <SUGGESTEDVALUES>
          <LISTITEM value="&lt;None&gt;" />
        </SUGGESTEDVALUES>
        <HELPTEXT>The build in which the bug was fixed</HELPTEXT>
      </FIELD>
    </FIELDS>
    <WORKFLOW>
      <STATES>
        <STATE value="Active">
          <FIELDS>
            <FIELD refname="Microsoft.VSTS.Common.ClosedDate">
              <EMPTY />
            </FIELD>
            <FIELD refname="Microsoft.VSTS.Common.ClosedBy">
              <EMPTY />
            </FIELD>
          </FIELDS>
        </STATE>
        <STATE value="Closed" />
      </STATES>
      <TRANSITIONS>
        <TRANSITION from="" to="Active">
          <REASONS>
            <DEFAULTREASON value="New" />
          </REASONS>
          <FIELDS>
            <FIELD refname="Microsoft.VSTS.Common.ActivatedBy">
              <COPY from="currentuser" />
              <VALIDUSER />
              <REQUIRED />
            </FIELD>
            <FIELD refname="Microsoft.VSTS.Common.ActivatedDate">
              <SERVERDEFAULT from="clock" />
            </FIELD>
            <FIELD refname="System.AssignedTo">
              <DEFAULT from="currentuser" />
            </FIELD>
          </FIELDS>
        </TRANSITION>
        <TRANSITION from="Active" to="Closed">
          <REASONS>
            <DEFAULTREASON value="Issue Resolved" />
          </REASONS>
          <FIELDS>
            <FIELD refname="System.AssignedTo">
              <COPY from="field" field="System.CreatedBy" />
            </FIELD>
            <FIELD refname="Microsoft.VSTS.Common.ActivatedDate">
              <READONLY />
            </FIELD>
            <FIELD refname="Microsoft.VSTS.Common.ActivatedBy">
              <READONLY />
            </FIELD>
            <FIELD refname="Microsoft.VSTS.Common.ClosedBy">
              <COPY from="currentuser" />
              <VALIDUSER />
              <REQUIRED />
            </FIELD>
            <FIELD refname="Microsoft.VSTS.Common.ClosedDate">
              <SERVERDEFAULT from="clock" />
            </FIELD>
          </FIELDS>
          <ACTIONS>
            <ACTION value="Microsoft.VSTS.Actions.Checkin" />
          </ACTIONS>
        </TRANSITION>
        <TRANSITION from="Closed" to="Active">
          <REASONS>
            <DEFAULTREASON value="Reactivated" />
          </REASONS>
          <FIELDS>
            <FIELD refname="Microsoft.VSTS.Common.ActivatedBy">
              <COPY from="currentuser" />
              <VALIDUSER />
              <REQUIRED />
            </FIELD>
            <FIELD refname="Microsoft.VSTS.Common.ActivatedDate">
              <SERVERDEFAULT from="clock" />
            </FIELD>
            <FIELD refname="System.AssignedTo">
              <COPY from="field" field="Microsoft.VSTS.Common.ClosedBy" />
            </FIELD>
          </FIELDS>
        </TRANSITION>
      </TRANSITIONS>
    </WORKFLOW>
    <FORM>
      <Layout>
        <Group>
          <Column PercentWidth="100">
            <Control FieldName="System.Title" Type="FieldControl" Label="&amp;Title:" LabelPosition="Left" />
          </Column>
        </Group>
        <Group>
          <Column PercentWidth="50">
            <Group Label="Status">
              <Column PercentWidth="100">
                <Control FieldName="System.AssignedTo" Type="FieldControl" Label="Assi&amp;gned To:" LabelPosition="Left" />
                <Control FieldName="System.State" Type="FieldControl" Label="&amp;State:" LabelPosition="Left" />
                <Control FieldName="System.Reason" Type="FieldControl" Label="&amp;Reason:" LabelPosition="Left" />
              </Column>
            </Group>
          </Column>
          <Column PercentWidth="50">
            <Group Label="Classification">
              <Column PercentWidth="100">
                <Control FieldName="System.AreaPath" Type="WorkItemClassificationControl" Label="&amp;Area:" LabelPosition="Left" />
                <Control FieldName="System.IterationPath" Type="WorkItemClassificationControl" Label="Ite&amp;ration:" LabelPosition="Left" />
              </Column>
            </Group>
          </Column>
        </Group>
        <Group>
          <Column PercentWidth="100">
            <Group Label="Planning">
              <Column PercentWidth="33">
                <Control FieldName="Microsoft.VSTS.Common.StackRank" Type="FieldControl" Label="Stack Ran&amp;k:" LabelPosition="Left" NumberFormat="DecimalNumbers" MaxLength="10" />
              </Column>
              <Column PercentWidth="33">
                <Control FieldName="Microsoft.VSTS.Common.Priority" Type="FieldControl" Label="&amp;Priority:" LabelPosition="Left" />
              </Column>
              <Column PercentWidth="33">
                <Control FieldName="Microsoft.VSTS.Scheduling.DueDate" Type="DateTimeControl" Label="D&amp;ue Date:" LabelPosition="Left" Format="Short" />
              </Column>
            </Group>
          </Column>
        </Group>
        <TabGroup>
          <Tab Label="Details">
            <Group>
              <Column PercentWidth="50">
                <Control FieldName="System.Description" Type="HtmlFieldControl" Label="&amp;Description:" LabelPosition="Top" Dock="Fill" />
              </Column>
              <Column PercentWidth="50">
                <Control FieldName="System.History" Type="WorkItemLogControl" Label="&amp;History:" LabelPosition="Top" Dock="Fill" />
              </Column>
            </Group>
          </Tab>
          <Tab Label="Links">
            <Control Type="LinksControl" Name="IssueLinks" LabelPosition="Top">
              <LinksControlOptions>
                <LinkColumns>
                  <LinkColumn RefName="System.ID" />
                  <LinkColumn RefName="System.WorkItemType" />
                  <LinkColumn RefName="System.Title" />
                  <LinkColumn RefName="System.AssignedTo" />
                  <LinkColumn RefName="System.State" />
                  <LinkColumn LinkAttribute="System.Links.Comment" />
                </LinkColumns>
                <WorkItemLinkFilters FilterType="includeAll" />
                <ExternalLinkFilters FilterType="includeAll" />
                <WorkItemTypeFilters FilterType="includeAll" />
              </LinksControlOptions>
            </Control>
          </Tab>
          <Tab Label="Attachments">
            <Control Type="AttachmentsControl" LabelPosition="Top" />
          </Tab>
        </TabGroup>
      </Layout>
    </FORM>
  </WORKITEMTYPE>
</Witd:WITD>